import warnings

from keras.layers import Flatten, Dense
from keras.layers import Input
from keras.models import Model

warnings.filterwarnings('ignore')


def train(x_train, y_train):
    simple_input = Input(shape=(2, 1))
    flat = Flatten()(simple_input)
    den1 = Dense(256, activation='sigmoid')(flat)
    output = Dense(1, activation='sigmoid')(den1)
    model = Model(inputs=simple_input, outputs=output)
    model.summary()
    model.compile(loss='mean_squared_logarithmic_error',
                  optimizer='rmsprop',
                  metrics=['accuracy'])
    model.fit(x_train, y_train, epochs=20, batch_size=20)
